import config from "@/config/index.js"

function decode(url){
	if(config.baseUrl.startsWith('https://jx.sxfw365.com')){
		if(url.startsWith('http://')){
			return 'https' + url.substring(4);
		} else {
			return url;
		}
	}else{
		return config.baseUrl.substring(0, config.baseUrl.lastIndexOf(':')+1) + url.split(':')[2];
	}
}

module.exports = { decode }
